@import '../kit/styleKitIndex.scss';

/* 按钮样式 */
@mixin button-rect {
    border: none;
    min-width: $button-min-width;
    width: auto;
    padding: 0 15px;
    height: $button-height;
    line-height: $button-height;
}
@mixin button-circle {
    border-radius: 14px;
    width: $button-icon-width;
    height: $button-icon-height;
    min-width: auto;
    padding: 0;
}

.ivu-btn-primary {
    background-color: $color-button-ensure;
    &.ivu-btn-circle {
        min-width: $button-min-width;
        width: auto;
        height: $button-height;
    }
    &.ivu-btn-circle.ivu-btn-small {
        @include button-circle;
        text-indent: 2px;
    }
    &:hover {
        background-color: $color-button-ensure-hover;
    }
    &[disabled] {
        background-color: $color-button-ensure-disabled;
        color: $color-font9;
    }
}

.ivu-btn-warning {
    @include button-rect;
    background-color: $color-button-cancel;
    &.ivu-btn-circle.ivu-btn-small {
        @include button-circle;
        text-indent: 2.2px;
    }
    &:hover {
        background-color: $color-button-cancel-hover;
    }
    &[disabled] {
        background-color: $color-button-cancel-disabled;
        color: $color-font9;
    }
}

.ivu-btn-primary.disabled, .ivu-btn-primary[disabled], fieldset[disabled] .ivu-btn-primary, .ivu-btn-primary.disabled:hover, .ivu-btn-primary[disabled]:hover, fieldset[disabled] .ivu-btn-primary:hover, .ivu-btn-primary.disabled:focus, .ivu-btn-primary[disabled]:focus, fieldset[disabled] .ivu-btn-primary:focus, .ivu-btn-primary.disabled:active, .ivu-btn-primary[disabled]:active, fieldset[disabled] .ivu-btn-primary:active, .ivu-btn-primary.disabled.active, .ivu-btn-primary[disabled].active, fieldset[disabled] .ivu-btn-primary.active {
    background-color: $color-button-ensure-disabled;
    color: $color-font9;
}
.ivu-btn-warning.disabled, .ivu-btn-warning[disabled], fieldset[disabled] .ivu-btn-warning, .ivu-btn-warning.disabled:hover, .ivu-btn-warning[disabled]:hover, fieldset[disabled] .ivu-btn-warning:hover, .ivu-btn-warning.disabled:focus, .ivu-btn-warning[disabled]:focus, fieldset[disabled] .ivu-btn-warning:focus, .ivu-btn-warning.disabled:active, .ivu-btn-warning[disabled]:active, fieldset[disabled] .ivu-btn-warning:active, .ivu-btn-warning.disabled.active, .ivu-btn-warning[disabled].active, fieldset[disabled] .ivu-btn-warning.active {
    background-color: $color-button-cancel-disabled;
    color: $color-font9;
}

.ivu-btn {
    border-radius: 0px;
    @include button-rect;
}
.ivu-btn-circle, .ivu-btn-circle-outline {
    border-radius: 14px;
}
.ivu-btn-long {
    width: 100%;
}
.ivu-btn-large {
    padding: 0;
    height: $button-height-l;
    line-height: $button-height-l;
    font-size: $font-size-xl;
}
.ivu-btn-ghost {
    border-color: #dddee1;
    border-width: 1px;
    border-style: solid;
    border-radius: 2px;
}
.ivu-btn-icon {
    text-indent: -99999px;
    overflow: hidden;
    .ivu-icon {
        vertical-align: 6px;
    }
}

/* 复选框 */
.ivu-checkbox-checked .ivu-checkbox-inner {
    border-color: $color-button-ensure;
    background-color: $color-button-ensure;
}
.ivu-checkbox-input {
    border-radius: 2px;
    width: 14px;
    height: 14px;
    border-color: #e5e5e5;
}
.ivu-checkbox-disabled .ivu-checkbox-inner {
    background-color: rgba(255, 255, 255, 0);
    border-color: rgba(229, 229, 229, .5);
}

/* 单选框 */
.ivu-radio-inner {
    border-color: #bdc3c5;
    &:after {
        opacity: 1;
        transform: scale(.75);
        background-color: #a8afb2;
    }
}
.ivu-radio-checked {
    .ivu-radio-inner {
        background-color: $color-button-ensure;
        border-color: $color-button-ensure;
        &:after {
            transform: scale(.5);
            background-color: #fff;
        }
    }
}

/* 分页 */
.ivu-page-prev, .ivu-page-next, .ivu-page-item-jump-prev, .ivu-page-item-jump-next, .ivu-page-item {
    text-indent: 0;
}
.ivu-page-item-active {
    background-color: $color-button-ensure;
}
.ivu-page {
    float: left;
}

/* 标签 */
.ivu-tag {
    border-radius: 12px;
    padding: 0 14px;
}
.ivu-tag-green, .ivu-tag-green.ivu-tag-dot .ivu-tag-dot-inner {
    background-color: $color-tag-green;
}
.ivu-tag-yellow, .ivu-tag-yellow.ivu-tag-dot .ivu-tag-dot-inner {
    background-color: $color-tag-yellow;
}
.ivu-tag-red, .ivu-tag-red.ivu-tag-dot .ivu-tag-dot-inner {
    background-color: $color-tag-red;
}

/* 下拉框 */
.ivu-dropdown-wrapper {
    display: inline-block;
    .preference {
        margin-right: 5px;
    }
}
.ivu-dropdown .ivu-icon {
    color: #ccd8e0;
    &:hover {
        color: $color-button-ensure;
    }
}

/* select */
.ivu-select-single .ivu-select-selection {
    border-radius: 2px;
    height: $select-height;
}
.ivu-select-single .ivu-select-selection .ivu-select-placeholder, .ivu-select-single .ivu-select-selection .ivu-select-selected-value, .ivu-select-single .ivu-select-selection .ivu-select-input {
    border-radius: 2px;
    height: $select-height;
    line-height: $select-height;
}

/* form */
.ivu-form-grid-1 {
    max-width: $form-item-label-width + $form-item-width-l;
}
.ivu-form-grid-2 {
    max-width: ($form-item-label-width + $form-item-width-l) * 2;
}
.ivu-form-grid-3 {
    max-width: ($form-item-label-width + $form-item-width-l) * 3;
}
.ivu-form-grid-0, .ivu-form-grid-1, .ivu-form-grid-2, .ivu-form-grid-3 {
    .ivu-form-item {
        display:  inline-block;
    }
}
.ivu-form-grid-2, .ivu-form-grid-3 {
    .ivu-form-item:not(:nth-last-of-type(1)) {
        margin-right: 50px;
    }
}
.ivu-form-grid-0, .ivu-form-grid-1 {
    .ivu-form-item:not(:nth-last-of-type(1)) {
        margin-right: $form-item-width-gap;
    }
}
.ivu-from-item-oper {
    display: inline-block;
    line-height: 30px;
    padding-left: 5px;
    button:not(:nth-of-type(1)) {
        margin-left: 10px;
    }
}
.ivu-form-item-required .ivu-form-item-label:before {
    content: "\e66a";
    color: #ffbe2e;
    font-family: "iconfont";
    font-size: 13px;
    margin-left: -23px;
    margin-right: 10px;
}

/* form-label */
.ivu-form .ivu-form-item-label{
    color: $color-font2;
    font-size: $font-size-m;
}

.ivu-form-item .ivu-form-item {
    margin-bottom: 24px;
}
